<?php
$this->frontend_lib->setACss(shop_assets('css/flexslider.css', $this->shop->template));
$this->frontend_lib->setAJs(shop_assets('js/jquery.flexslider.js', $this->shop->template));
?>

<div class="row">
    <div class="col-md-5 col-xs-12 mgt-10">
        <!-- FlexSlider -->
        <section class="slider">
            <?php if(isset($shop_slides) && count($shop_slides)>0) { ?>
            <div class="flexslider">
                <ul class="slides">
                    <?php foreach($shop_slides as $index=>$oImage) { ?>
                    <li><img src="<?php echo slide_upload($oImage->image, $oImage->image_folder, FALSE); ?>" alt="" /></li>
                    <?php } ?>
                </ul>
            </div>
            <?php } ?>
        </section>
        <!-- FlexSlider -->
    </div>
    <div class="col-md-7 col-xs-12 visible-md visible-lg visible-sm">
        <div class="row">
            <?php $aTopHighlight = array_slice($aProductHighlight, 0, 4); ?>
            <?php foreach ($aTopHighlight as $key => $product) { ?>
            <div class="col-md-6 col-xs-12 mgt-5">
                <div class="card card-product clear-mgr clear-bdr">
                    <div class="row">
                        <div class="col-md-6 col-xs-12 col-sm-6">
                            <a class="thumbnail no-bdr" href="<?php echo shop_product_url($shop->getSlug(), $product->slug); ?>">
                                <img src="<?php echo product_upload($product->image, $product->shop_image_folder); ?>" alt="<?php echo $product->title; ?>" title="<?php echo $product->title; ?>" />
                            </a>
                        </div>
                        <div class="col-md-6 col-xs-12 col-sm-6">
                            <h4 class="title text-uppercase"><?php echo substr($product->title, 0, 10); ?> ...</h4>
                            <p class="description mgt-5"><?php echo substr(str_pad($product->description, 40), 0, 40); ?> ...</p>
                            <p class="mgt-5 price price-new"><?php echo currency_format($product->price_new); ?></p>
                            <a href="<?php echo shop_product_url($shop->getSlug(), $product->slug); ?>" class="btn btn-info btn-simple clear-font text-uppercase"><i class="fa fa-angle-right"></i> Chi tiết</a>
                        </div>
                    </div>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
    <div class="clearfix"></div>
</div>

<div class="row">
    <?php $this->frontend_lib->renderModule('getNewProduct', SMARTSTORE_HOME_PRODUCT_LIMIT, true); ?>
    <?php $this->frontend_lib->renderModule('getSaleProduct', SMARTSTORE_HOME_PRODUCT_LIMIT, true); ?>
    <?php $this->frontend_lib->renderModule('getHighlightProduct', SMARTSTORE_HOME_PRODUCT_LIMIT, true, $aProductHighlight); ?>
</div>